import jakarta.servlet.ServletException;
import jakarta.servlet.http.HttpServlet;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;

import jakarta.servlet.annotation.WebServlet;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Enumeration;
import java.util.List;

/**
 * @Author leiHua
 * @Date 2022/9/9 16:20
 */
@WebServlet("/login")
public class DoLogin extends HttpServlet {
    @Override
    protected void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        String username = request.getParameter("username");
        String password = request.getParameter("password");

        if (username.equals("雷华") &password.equals("2040706301")){
            request.setAttribute("username",username);
            request.setAttribute("password",password);
            System.out.println(username+password);
        }
        request.getRequestDispatcher("index.jsp").forward(request,response);

    }
}

